<#-- @ftlvariable name="categories" type="java.util.List<my.model.Category>" -->
<#-- @ftlvariable name="category" type="my.model.Category" -->

<!doctype html>
<html lang="zh">
<@block name="head">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <@block name="header">
        <script src="${base}/scripts/jquery.js"></script>
        <script src="${base}/scripts/semantic.min.js"></script>
        <link rel="stylesheet" href="${base}/themes/semantic.min.css">
        <link rel="stylesheet" href="${base}/themes/main.css">
        <@block name="resources"></@block>
    </@block>
    <title><@block name="title"></@block></title>
    <@block name="style">
        <style>

        </style>
    </@block>
</head>
</@block>


<body>

<div class="ui top fixed inverted stackable menu" id="navbar">
    <div class="ui container">
        <div class="header item">
            <a href="${base}/">首页</a>
        </div>


    <#if categories ??>  <!--需要判断下categories是否存在，否则直接循环freemaker可能会报错-->
        <#list categories as category>
            <div class="item">
                <a href="${base}/category/${category.id!''}">${category.name!''}</a>
            </div>
        </#list>
    </#if>

        <div class="item">
            <div class="ui icon input">
                <i class="search icon"></i>
                <input type="text" name="searchcontent" placeholder="搜索...">
            </div>
        </div>

        <div class="item">
            <a href="${base}/message/list">留言列表</a>
        </div>
    <#if (session.user)??>
        <div class="ui right dropdown item">
            <i class="user icon"></i>
        ${(session.user.nickname)!''}
            <i class="dropdown icon"></i>
            <div class="menu">
                <a href="${base}/admin" class="item">管理后台</a>
                <a href="${base}/logout" class="item">登出</a>
            </div>
        </div>
    <#else>
        <div class="right item"><a href="${base}/login">登录</a></div>
        <div class="item"><a href="${base}/register">注册</a></div>
    </#if>

    </div>
</div> <!-- end menu -->

<div class="ui stackable grid container" id="main-container" style="min-height:97%;">
<@block name="main-content">

</@block>
<@block name="additional"></@block>

</div>

<div class="ui vertical attached bottom inverted footer segment" id="footer">
    <div class="ui center aligned text container">
    <@block name="footer">宁夏大学信息工程学院 版权所有 2017－2020 </@block>
    </div>
</div>

</body>

<script>
    $(document).ready(function () {
        $(".ui.dropdown").dropdown();

    });
</script>

<@block name="script">
<script>
</script>
</@block>


</html>
